Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sshdriver: log verbose scp output #1285

Conversation

nick-potenski
Copy link
Contributor

@nick-potenski nick-potenski commented Oct 18, 2023

Description
Adds the -v option to all scp calls and saves the output to the logger. The get and put methods log at warning level on failure and the scp method logs at info level always. The additional output can help debug scp failures. Tested by trying to transfer non-existent files in both directions inside a test and verifying that the pytest logs included similar output to raw calls to scp.

Checklist

  • PR has been tested

Adds the `-v` option to all scp calls and saves the output to the
logger.  The additional output can help debug scp failures.

Signed-off-by: Nick Potenski <[email protected]>
@nick-potenski nick-potenski changed the title Log verbose scp output sshdriver: log verbose scp output Oct 18, 2023
@codecov
Copy link

codecov bot commented Oct 18, 2023

Codecov Report

Attention: 13 lines in your changes are missing coverage. Please review.

Comparison is base (0657977) 63.0% compared to head (c019b77) 62.9%.

Additional details and impacted files
@@           Coverage Diff            @@
##           master   #1285     +/-   ##
========================================
- Coverage    63.0%   62.9%   -0.1%     
========================================
  Files         160     160             
  Lines       11902   11907      +5     
========================================
- Hits         7500    7499      -1     
- Misses       4402    4408      +6     
Files Coverage Δ
labgrid/driver/sshdriver.py 54.0% <13.3%> (-1.5%) ⬇️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Bastian-Krause
Copy link
Member

Thanks for thinking about contributing. I can't really see how this "debugging improvement" benefits labgrid. Even without this change, critical output of scp should still be visible on stdout, right? What kind of errors are you debugging?

@nick-potenski
Copy link
Contributor Author

In this case, a call to SSHDriver.put() failed. The only output was lost connection. I thought that adding the -v would be beneficial debugging and might give more details on which connection was lost. I don't necessarily need it to go to the logger, just thought that might be nicer.

@Bastian-Krause
Copy link
Member

Hm, I see why you've added that for your debugging session, but I don't think that adding -v to scp and logging its output belongs into labgrid.

@Bastian-Krause
Copy link
Member

As explained earlier, I'll close this.

@nick-potenski nick-potenski deleted the log-verbose-scp-output branch April 11, 2024 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants